﻿<%@ Page Language="C#" MasterPageFile="~/Masterlayout.master" AutoEventWireup="true" CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style>
.tb5 {
	        border:2px solid #456879;
	        border-radius:10px;
	        
             margin-left: 0px;
            
          }
          </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        <table style="margin-left:40px">
            <tr>
             <td>
                <table>
                        <tr>
                            <td>
                                Order ID
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlOrderID" runat="server" Width="180px" class="tb5"></asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>Product</td>
                            <td>
                                <asp:DropDownList ID="ddlProduct" runat="server" Width="180px" class="tb5"></asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>Unit price</td>
                            <td>
                                <asp:TextBox ID="txtUnitPrice" required runat="server" Width="175px" class="tb5"></asp:TextBox>
                                <asp:CompareValidator ID="CompareValidator4" runat="server" 
                                    ControlToValidate="txtUnitPrice" Display="Dynamic" 
                                    ErrorMessage="Must be nunber and greater than 0" Operator="GreaterThanEqual" 
                                    Type="Double" ValueToCompare="0"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>Quantity</td>
                            <td>
                                <asp:TextBox ID="txtQuantity" required runat="server" Width="175px" class="tb5"></asp:TextBox>
                                <asp:CompareValidator ID="CompareValidator5" runat="server" 
                                    ControlToValidate="txtQuantity" Display="Dynamic" 
                                    ErrorMessage="Must be integer nunber and greater than 0" 
                                    Operator="GreaterThanEqual" Type="Integer" ValueToCompare="0"></asp:CompareValidator>
                            </td>
                            
                        </tr>
                        <tr>
                            <td>Discount</td>
                            <td>
                                <asp:TextBox ID="txtDiscount" required runat="server" Width="175px" class="tb5"></asp:TextBox>
                                <asp:CompareValidator ID="CompareValidator6" runat="server" 
                                    ControlToValidate="txtDiscount" Display="Dynamic" 
                                    ErrorMessage="Must be nunber and greater than 0" Operator="GreaterThanEqual" 
                                    Type="Double" ValueToCompare="0"></asp:CompareValidator>
                                <asp:CompareValidator ID="CompareValidator7" runat="server" 
                                    ControlToValidate="txtDiscount" Display="Dynamic" 
                                    ErrorMessage="Must be nunber and less than 1" Operator="LessThanEqual" 
                                    Type="Double" ValueToCompare="1"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                        <td colspan="2">
                            <asp:Button ID="btnNewDetail" Text="New" Width="65px" runat="server" 
                                onclick="btnNewDetail_Click" CausesValidation="False" formnovalidate class="tb5"/>
                            <asp:Button ID="btnAddDetail" Text="Add" Width="65px" runat="server" 
                                onclick="btnAddDetail_Click" class="tb5"/>
                            <asp:Button ID="btnUpdateDetail" Text ="Update" Width="65px" runat="server" 
                                Enabled="False" onclick="btnUpdateDetail_Click" class="tb5"/>
                            <asp:Button ID="btnDeleteDetail" Text="Delete" Width="65px" runat="server" 
                                Enabled="False" onclick="btnDeleteDetail_Click" OnClientClick="if(!confirmDelete()) return false;" class="tb5"/>
                            <asp:Button ID="txtReloadDetail" Text="Reload" Width="65px" runat="server" 
                                onclick="txtReloadDetail_Click" CausesValidation="False" formnovalidate class="tb5"/>
                           
                            </td>
                        </tr>
                    </table>
            </td>
            <td width="70%"> 
                <asp:GridView ID="gvOrderDetails" runat="server" Width="800px" 
                    onpageindexchanging="gvOrderDetails_PageIndexChanging" 
                    onselectedindexchanged="gvOrderDetails_SelectedIndexChanged"
                    BackColor="White"
                    ForeColor="Black"
                     SelectedRowStyle-ForeColor="White"
                    
                    >
                    <HeaderStyle BackColor="Orange" />
                         <EditRowStyle ForeColor="Black" />
                        <AlternatingRowStyle BackColor="DarkGray" />
                         <SelectedRowStyle BackColor="BlueViolet" />
                    </asp:GridView>
            </td>
            </tr>
            
            <tr height="50px">
               <td colspan="2">
                <hr style="border-style: double; border-width: medium" width="70%" />
               </td> 
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="btnGoBackOrder" runat="server" Text="Go Back" formnovalidate 
                        onclick="btnGoToOrderDetails_Click" CausesValidation="False" />
                </td>
                
            </tr>
        </table>
        
    </div>

</asp:Content>

